package fr.neyb.bernouilli.problem011;

import java.io.IOException;
import java.io.InputStreamReader;

public class Entry {

	public static void main(String[] args) throws IOException {
		Grid g = Grid.parse(
				new InputStreamReader(Entry.class
						.getResourceAsStream("grid.txt")), 4);

		int currProd;
		int max = 0;

		for (Grid.Direction dir : Grid.Direction.values()) {
			for (IntReader ir = g.getIntReader(dir); (currProd = ir.readNext()) != -1;) {
				if (max < currProd)
					max = currProd;
			}
		}

		System.out.println(max);

	}
}
